package org.example.registry;

import org.example.Model.ServiceMetaInfo;
import org.example.config.RegistryConfig;

import java.util.List;

/**
 * @Author Jiangxiaonan
 * @Description 注册中心
 * @Date 2024/9/9 21:58
 **/
public interface IRegistry {

    // 初始化
    void init(RegistryConfig config);

    // 注册
    void register(ServiceMetaInfo serviceMetaInfo) throws Exception;

    // 注销（服务端）
    void deregister(ServiceMetaInfo serviceMetaInfo);

    // 发现
    List<ServiceMetaInfo> discovery(String serviceKey);

    // 服务销毁
    void destroy();

    // 心跳
    void heartbeat();
}
